<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>

<h:body>
	<ui:composition template="/XHTML/CommonColumnsContent.xhtml">

		<ui:define name="body">
			<f:view>
				<p:ajaxStatus onstart="statusDialog.show();"
					onsuccess="statusDialog.hide();" />
				<p:dialog modal="true" widgetVar="statusDialog" header="Cargando..."
					draggable="false" closable="false">
					<p:graphicImage
						value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName}:#{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath}/images/ajaxloadingbar.gif" />
				</p:dialog>

				<h:form style="width:450px; position:absolute;">
					<br />
					<p:panel id="msgProjectColegioTitle" header="Colegio" >
						<p:messages id="msg" showDetail="false" />
						<p:growl id="men" />
						<h:panelGrid columns="2" id="panelgrande">

							<h:panelGrid columns="2" id="panel" width="">
								<h:outputText id="msgColecoddanen" value=" DANE" />
								<p:inputText id="txtColecoddanen" style="width: 185;"
									onkeypress="if (event.keyCode == 13) return false;"
									binding="#{colegioView.txtColecoddanen}" maxlength="20"
									required="true" requiredMessage="Ingresar un código DANE"
									validatorMessage="Ingresar solo números sin espacios">
									<f:validateRegex pattern="[0-9]+" />
									<p:ajax update="panel,msg,panelBotones"
										listener="#{colegioView.listener_txtDane}" />
								</p:inputText>
								<h:outputText id="msgColedescripv" value=" Nombre" />
								<p:inputText id="txtColedescripv" disabled="true"
									style="width: 185;" binding="#{colegioView.txtColedescripv}" />

								<h:outputText value="Departamento: " />
								<p:selectOneMenu id="cmbDptos" value="#{colegioView.dptoSelect}"
									style="width: 178;" binding="#{colegioView.cmbDpto}"
									disabled="false" styleClass="inputstyle">
									<f:selectItem itemLabel="Seleccione Uno" itemValue="0" />
									<f:selectItems value="#{colegioView.listDpto}" var="dpto"
										itemLabel="#{dpto.lugadescripv}" itemValue="#{dpto.lugaidn}" />
									<p:ajax event="change"
										listener="#{colegioView.listener_CmbDpto}"
										update="cmbCiudades" />
								</p:selectOneMenu>

								<h:outputText value="Ciudad: " />
								<p:selectOneMenu id="cmbCiudades"
									value="#{colegioView.ciuSelect}" style="width: 178;"
									binding="#{colegioView.cmbCiudad}" disabled="false">
									<f:selectItem itemLabel="Seleccione Uno" itemValue="0" />
									<f:selectItems value="#{colegioView.listCiudad}" var="ciu"
										itemLabel="#{ciu.lugacoddanen}"
										itemValue="#{ciu.lugacoddanen}" />
								</p:selectOneMenu>
							</h:panelGrid>
							<p:graphicImage url="/images/logo3editores.png" />
						</h:panelGrid>
						<h:panelGrid id="panelBotones" columns="3" style="margin: 0 auto">
							<p:commandButton id="btnSave" disabled="true" value="Guardar"
								action="#{colegioView.action_save}"
								update="msg,panel,panelBotones" binding="#{colegioView.btnSave}" />
							<p:commandButton id="btnModify" disabled="true" value="Modificar"
								action="#{colegioView.action_modify}"
								update="msg,panel,panelBotones"
								binding="#{colegioView.btnModify}" />
							<p:commandButton id="btnClear" disabled="false" value="Limpiar"
								action="#{colegioView.action_clear}"
								update="msg,panel,panelBotones"
								binding="#{colegioView.btnClear}" />

						</h:panelGrid>

						<br/><a href="http://www.mineducacion.gov.co/buscandocolegio/" target="_blank"><h:outputText value="Ministerio de Educación" style="padding-left: 280"/></a><br/>

					</p:panel>
				
				</h:form>
			</f:view>
		</ui:define>

	</ui:composition>
</h:body>

</html>
